<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sinox="http://www.sinosoft.com.cn/sinox"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:decorate template="/layout/input/editable-template.xhtml">
		<!-- 第一行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compType" value="single" />
			<ui:param name="compBean1Id" value="duedate" />
			<ui:param name="compBean1Lable" value="活动持续时间" />
			
			<ui:define name="compBean1Content">
				 <h:inputText id="#{compBean1Id}" value="#{partViewBean.fields.duedate}" />
			</ui:define>
			
		</ui:decorate>
		
		<!-- 第二行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compType" value="single-all" />
			<ui:param name="compBean1Id" value="awokesTable" />
			<ui:param name="compBean1Editable" value="false" />
			
			<ui:define name="compBean1Content">
				<p:toolbar height="22px" styleClass="sino-toolbar-on-datatable">
					<p:toolbarGroup align="left">
				    	<div style="float:left;">
				    		<p:spacer width="10" height="25" />
				    	</div>
				    	<div style="float:left;margin-top:5px;">
				    		<h:outputText value="提醒策略列表"/>
				    	</div>
				    </p:toolbarGroup>
				    
				    <p:toolbarGroup align="right">
				    	<p:commandButton title="添加" value="添加"
							actionListener="#{bpmAction.addAwokeAction}"
							update="#{compBean1Id}">
							<h:inputHidden value="#{partViewBean.id}" />
						</p:commandButton>
						
						<p:commandButton title="删除" value="删除"
							actionListener="#{bpmAction.removeAwokeAction}"
							update="#{compBean1Id}">
							<h:inputHidden value="#{partViewBean.id}" />
						</p:commandButton>
				    </p:toolbarGroup>
				</p:toolbar>
				
				<p:dataTable id="#{compBean1Id}" var="awoke" value="#{partViewBean.awokes}"
			        emptyMessage="请添加提醒策略" selectionMode="multiple" rowIndexVar="awokesvar"
			        selection="#{partViewBean.selectedRows}">
			  		
			  		<p:column headerText="序号" style="width:20px;">
			  			<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{awokesvar + 1}"/>
			                </f:facet>  
			                <f:facet name="input">
								<h:outputText value="#{awokesvar + 1}"/>
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="提醒类型" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{bpmSelectItemsService.itemsMap['awokeType'][awoke.type]}" />  
			                </f:facet>  
			                <f:facet name="input">
			                	<sinox:selectOneMenu value="#{awoke.type}"
									items="#{bpmSelectItemsService.items.awokeType}" width="150" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="重复时间" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{awoke.value}" />分钟
			                </f:facet>  
			                <f:facet name="input">  
			                    <h:inputText value="#{awoke.value}" style="width:100%"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="重复次数" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{awoke.repeatNum}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <p:spinner value="#{awoke.repeatNum}" min="0" style="width:50px;"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="是否消息提示" style="width:70px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{(awoke.jms)?'是':'否'}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <sinox:selectBooleanCheckbox value="#{awoke.jms}" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="是否短信提示" style="width:70px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{(awoke.sms)?'是':'否'}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <sinox:selectBooleanCheckbox value="#{awoke.sms}" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="提示内容">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{awoke.tip}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <h:inputText value="#{awoke.tip}" style="width:100%"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
			  		
			  		 <p:column headerText="编辑" style="width:20px;">  
			            <p:rowEditor />  
			        </p:column>
			    </p:dataTable>
			</ui:define>
		</ui:decorate>
		
	</ui:decorate>
</ui:composition>